home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 40 / 040.d81 / sound synthesize (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  7KB  |  200 lines

  1. 5 poke53280,11 :poke53281,11
  2. 10 gosub 6000
  3. 20 :
  4. 25 print"[147]"          chr$(142)
  5. 30 poke646,1:poke53281,.
  6. 40 sf=90
  7. 50 dn$="":rt$=""
  8. 55 f$(0)="[150]off[155]":f$(1)=" on[155]"
  9. 60 e$="                                     ":s$=" "
  10. 61 mm$="            selection menu            "
  11. 62 mm$=mm$+" [152]make selection by pressing 1-e then"
  12. 63 mm$=mm$+" use the crsr keys to edit.  function"
  13. 64 mm$=mm$+" keys for command functions above[155]"
  14. 65 sp$="                                       ":forx=1to4
  15. 66 sp$=sp$+"                                       ":next
  16. 67 ss$="[145]                                       ":forx=1to2
  17. 68 ss$=ss$+"                                       ":next
  18. 70 pl$=""
  19. 72 dimp(14),a(14),x(14),x,i,y:fori=1to14:readx:next
  20. 80 fori=1to14:readp(i):next:fori=1to14:reada(i):next
  21. 85 fori=1to4:readwf$(i):next
  22. 90 print"[147]   s o u n d  s y n t h e s i z e r "
  23. 92 print"1[154] volume"
  24. 100 print"2[154] frequency            [155]hz":print"3 [154]duration             [155]sec"
  25. 110 print"4 [154]attack":print"5 [154]sustain             [152][213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]"
  26. 120 print"6 [154]decay              [152] [221]     menu      [152][221]"
  27. 130 print"7 [154]release            [152] [221] f1 [153]hear sound[152] [221]"
  28. 140 print"8 [154]low pass fltr      [152] [221] f2 [153]save sound[152] [221]"
  29. 150 print"9 [154]band pass fltr     [152] [221] f3 [153]list line [152] [221]"
  30. 160 print"a [154]high pass fltr     [152] [221] f4 [153]load sound[152] [221]"
  31. 170 print"b [154]fltr freq          [152] [221] f5 [153]restart   [152] [221]"
  32. 180 print"c [154]resonance          [152] [221] f6 [153]quit     [152]  [221]"
  33. 190 print"d [154]waveform           [152] [202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203]"
  34. 200 print"e [154]pulse width        [155]%"
  35. 205 printpl$mm$
  36. 210 rem ***start/restart***
  37. 220 :
  38. 230 fori=54272to54294:pokei,0:next:restore:fori=1to14:readx(i):next
  39. 240 forx=1to15
  40. 250 onxgosub1120,1130,1150,1120,1120,1120,1120,1180,1180,1180,1130,1120
  41. 260 ifx>12thenonx-12gosub1190,1130
  42. 270 next:forx=1to15
  43. 280 onxgosub610,630,1100,650,660,650,660,610,610,610,670,620,1100,690
  44. 290 next
  45. 300 rem ***key scan***
  46. 310 geta$:ifa$=""then310
  47. 320 a=asc(a$):ifa=133then710
  48. 330 ifa=137then870
  49. 340 ifa=138then950
  50. 350 ifa=134then750
  51. 360 ifa=135then210
  52. 370 ifa=139then6500
  53. 380 ifa>48anda<58thenx=val(a$):goto410
  54. 390 ifa>64anda<70thenx=a-55:goto410
  55. 400 goto310
  56. 410 rem ***change parameters***
  57. 420 printleft$(dn$,x+2)"[158][209][155]
  58. 430 [161]a$:[139]a$[178]""[167]430
  59. 440 a[178][198](a$):[139]a[178]13[167][153][200](dn$,x[170]2)" ":[141]1200:[137]590
  60. 450 [139]a[178]145[167]480
  61. 460 [139]a[178]17[167]510
  62. 470 [137]430
  63. 480 [139]x(x)[177][178]a(x)[167]430
  64. 490 [139]x[178]2[176]x[178]11[167]x(x)[178]x(x)[170]10:[137]540
  65. 500 x(x)[178]x(x)[170]1:[137]540
  66. 510 [139]x(x)[178]0[167]430
  67. 520 [139]x[178]2[176]x[178]11[167]x(x)[178]x(x)[171]10:[137]540
  68. 530 x(x)[178]x(x)[171]1
  69. 540 [139]x[178]1[176](x[177][178]4[175]x[179][178]7)[176]x[178]12[167][141]1120:[137]430
  70. 550 [139]x[178]2[176]x[178]11[176]x[178]14[167][141]1130:[137]430
  71. 560 [139]x[178]3[167][141]1150:[137]430
  72. 570 [139]x[177]7[175]x[179]11[167][141]1180:[137]430
  73. 580 [141]1190:[137]430
  74. 590 [145]x[141]610,630,1100,650,660,650,660,610,610,610,670,620,1100,690
  75. 600 [137]300
  76. 610 [151]54296,x(1)[170]x(8)[172]16[170]x(9)[172]32[170]x(10)[172]64
  77. 620 [151]54295,x(8)[170](x(9)[172]2)[170](x(10)[172]4)[170](x(12)[172]16):[142]
  78. 630 fo[178]x(2)[173]0.06097:hb[178][181](fo[173]256):lb[178][181](fo[171](256[172]hb))
  79. 640 [151]54272,lb:[151]54273,hb:[142]
  80. 650 [151]54277,x(4)[172]16[170]x(6):[142]
  81. 660 [151]54278,x(5)[172]16[170]x(7):[142]
  82. 670 h2[178][181](x(11)[173]8):l2[178][181](x(11)[171](8[172]h2))
  83. 680 [151]54293,l2:[151]54294,h2:[142]
  84. 690 pw%[178]x(14)[172]40.95:h3[178][181](pw%[173]256):l3[178][181](pw%[171](256[172]h3))
  85. 700 [151]54274,l3:[151]54275,h3:[142]
  86. 710 [143] ***hear sound***
  87. 720 dv[178]x(3)[172]sf
  88. 730 [151]54276,2[174](x(13)[170]3)[170]1
  89. 740 [129]i[178]1[164]dv:[130]:[151]54276,0:[137]300
  90. 750 [143] ***list line***
  91. 760 [153]pl$;sp$;pl$
  92. 770 [153]dn$"listpoke54272,"[202]([196](lb),2)":poke54273,"[202]([196](hb),2)
  93. 780 [153]"poke54274,"[202]([196](l3),2)":poke54275,"[202]([196](h3),2)
  94. 790 [153]"poke54277,"[202]([196](x(4)[172]16[170]x(6)),2);
  95. 800 [153]":poke54278,"[202]([196](x(5)[172]16[170]x(7)),2)
  96. 810 [153]"poke54293,"[202]([196](l2),2)":poke54294,"[202]([196](h2),2)
  97. 820 [153]"poke54296,";
  98. 830 [153][202]([196](x(1)[170]x(8)[172]16[170]x(9)[172]32[170]x(10)[172]64),2);
  99. 840 [153]":poke54295,"[202]([196](x(8)[170](x(9)[172]2)[170](x(10)[172]4)[170](x(12)[172]16)),2)
  100. 850 [153]"poke54276,"[202]([196](2[174](x(13)[170]3)[170]1),2)
  101. 860 [153]"fori=1to"[202]([196](dv),2)":next:poke54276,0"
  102. 861 [153]"cont  press space when ready to continuelist"
  103. 862 [161]a$:[139]a$[179][177]" " [167] 862
  104. 865 [153]pl$ss$sp$pl$mm$:[137] 300
  105. 870 [143] ***save sound***
  106. 880 [141]1030:[139]d$[178]"t"[167]910
  107. 890 [159]8,dn,8,"0:"[170]nm$[170]"s,w"
  108. 900 [137]920
  109. 910 [159]1,1,1,nm$
  110. 920 [129]i[178]1[164]14:[152]8,x(i):[139]st[178]0[167][130]
  111. 930 [160]8:[139]d$[178]"d"[167][141]1110
  112. 940 [160]1:[129]i[178]1[164]1000:[130]:[137]310
  113. 950 [143] ***load sound***
  114. 960 [141]1030:[139]d$[178]"t"[167]990
  115. 970 [159]8,dn,8,nm$[170]"s,r"
  116. 980 [137]1000
  117. 990 [159]1,1,0,nm$
  118. 1000 [129]i[178]1[164]14:[132]8,x(i):[139]st[178]0[167][130]
  119. 1010 [160]8:[139]d$[178]"d"[167][141]1110
  120. 1020 [160]1:[129]i[178]1[164]1000:[130]:[137]240
  121. 1030 [153]pl$ss$sp$pl$:[153]dn$:[153]"list(printdlist)isk or list(printtlist)ape :";
  122. 1031 [161]d$:[139]d$[178]""[167]1031
  123. 1032 [139]d$[178]"t"[176]d$[178]"(NULL)"[176]d$[178]"str$"[176]d$[178]"d"[167]1035
  124. 1033 [137] 1031
  125. 1035 [153]d$
  126. 1040 [139]d$[178]"t"[167]dn[178]1:[137]1080
  127. 1050 [139]d$[179][177]"d"[167]1030
  128. 1060 [153]"drive print# list(print8list-print11list)     cmdcmdcmd:";::ln[178]3:[141]8000:nd$[178]a$:dn[178][197](nd$)
  129. 1061 [139]dn[179]8 [176]dn[177]11 [167] [153]"on";:[137]1060
  130. 1070 [159]15,dn,15:[160]15:[139]st[179][177]0 [167][153]"     drive not present ":[137]1112
  131. 1080 [153]"file nameprint :";::ln[178]17:[141]8000:nm$[178]a$
  132. 1090 [139][195](nm$)[179]1[176][195](nm$)[177]16[167][153]"onon":[137]1080
  133. 1100 [142]
  134. 1110 [159]15,8,15:[132]15,a$,b$,c$,d$:[153]a$s$b$s$c$s$d$:[160]15
  135. 1112 [153]"cont  press space when ready to continuelist"
  136. 1113 [161]a$:[139]a$[179][177]" " [167] 1113
  137. 1114 [153]pl$ss$sp$pl$mm$:[142]
  138. 1120 [153][200](dn$,x[170]2)[200](rt$,p(x))[201]("  "[170][202]([196](x(x)),2),2)
  139. 1125 [142]
  140. 1130 [153][200](dn$,x[170]2)[200](rt$,p(x));
  141. 1140 [153][201]("    "[170][202]([196](x(x)),2),4):[142]
  142. 1150 jm$[178][202]([196](x(3)),2):jm$[178][200](jm$,[195](jm$)[171]1)[170]"."[170][201](jm$,1)
  143. 1160 [153][200](dn$,5)[200](rt$,18)[201]("  "[170]jm$,4)
  144. 1170 dv[178][197](jm$)[172]1e3:[142]
  145. 1180 [153][200](dn$,x[170]2)[200](rt$,17)f$(x(x)):[142]
  146. 1190 [153][200](dn$,13[170]2)[200](rt$,15)wf$(x(x)):[142]
  147. 1200 [142]
  148. 1210 [131]12,440,30,9,4,4,0,0,0,0,400,0,1,50
  149. 1220 [131]18,16,18,18,18,18,18,17,17,17,16,18,15,16
  150. 1230 [131]15,3990,100,15,15,15,15,1,1,1,2040,15,5,100
  151. 1240 [131]"  tri","  saw",pulse,noise
  152. 6000 :
  153. 6010 [153]"loadwait(NULL)tantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantan(NULL)";
  154. 6020 [153]"{$7d}                                      {$7d}";
  155. 6030 [153]"{$7d}          sysL O AcloseD S T AcloseR             {$7d}";
  156. 6040 [153]"{$7d}          listtab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(             {$7d}";
  157. 6050 [153]"{$7d}             stopPresents                 {$7d}";
  158. 6060 [153]"{$7d}                                      {$7d}";
  159. 6070 [153]"{$7d}           fnstopclosefnstop fnstopclosefnstop fnstop fnstopclosefnwait              {$7d}";
  160. 6080 [153]"{$7d}           fnstopclosefnstopclosefnstopclosefnstopclosefnstopclosefnstopclosefnwait              {$7d}";
  161. 6090 [153]"{$7d}           fnstopclosefnstopclosefnstopclosefnstopclosefnstopclosefnstopclosefnwait              {$7d}";
  162. 6100 [153]"{$7d}           fnfnfnfnfnfnfnfnfnfnfnfnfnwait              {$7d}";
  163. 6110 [153]"{$7d}           fnfnfnfnfnfnfnfnfnfnfnfnfnwait              {$7d}";
  164. 6120 [153]